import Vue from 'vue'
import store from '@/store'
const action = Vue.directive('action', {
  inserted: function (el, binding, vnode) {
    const actionName = binding.arg;
    const btns = store.getters.btns;
    const actionState = btns.includes(actionName);
    if (!actionState) {
       el.parentNode && el.parentNode.removeChild(el) || (el.style.display = 'none')
    }
  }
})
export default action
